package inet.app.controller.parser;


import inet.app.controller.connect.JsonParser;
import inet.app.model.object.Usrreg_Item;

import java.util.ArrayList;

import org.json.JSONObject;

import android.util.Log;

public class Parser_Usrreg {


	private ArrayList<Usrreg_Item> list = new ArrayList<Usrreg_Item>();
	private Usrreg_Item item;
	private String USRREG = "usrreg";
	
	public Parser_Usrreg () {
		
	}
	public ArrayList<Usrreg_Item> getList(String url) {
		list = new ArrayList<Usrreg_Item>();
		JSONObject jobject,object,job_items;
		JsonParser jParser = new JsonParser();
		jobject = jParser.getJSONFromUrl(url);
		try {
				String usrlogin = jobject.getString(USRREG);
				System.out.println("KICH HOAT : " + usrlogin);
				if(!usrlogin.equals("")){
					item = new Usrreg_Item(usrlogin);
					list.add(item);
				}else {
					list=null;
				}
			return list;
        } catch (Exception e) {
            Log.e("JSON Parser", "Error parsing data " + e.toString());
            return null;
        }
		
	}


}
